import { loadesFiles } from '@/utils'
import LoginLayout from '@/layout/LoginLayout.vue'
import config from '@/config/config'

import { RouteRecordRaw } from 'vue-router'

// 静态路由
export const staticRoutes = [
  {
    path: '/login',
    name: config.LoginMainLayoutName,
    meta: {
      title: '登陆',
      notAuth: true
    },
    redirect: { name: 'Login' },
    component: LoginLayout,
    children: loadesFiles(import.meta.glob('./login/*.ts', { eager: true }))
  },
  {
    path: '/kanban',
    name: config.KanBanName,
    meta: {
      title: '看板',
      notAuth: true
    },
    redirect: {
      name: 'KanbanHome'
    },
    component: () => import('@/layout/layout-shelf/remLayout.vue'),
    children: loadesFiles(import.meta.glob('./kanban/*.ts', { eager: true }))
  },
  {
    path: '/403',
    name: config.NotAuth403,
    meta: {
      title: '403',
      notAuth: true
    },
    component: () => import('@/views/403/403.vue')
  },
  {
    path: '/404',
    name: config.Error404Name,
    meta: {
      title: '404',
      notAuth: true
    },
    component: () => import('@/views/404/error404.vue')
  },
  // 以上路径不匹配，则走下面规则
  {
    path: '/:pathMatch(.*)',
    redirect: { name: config.Error404Name },
    meta: {
      notAuth: true
    }
  }
] as RouteRecordRaw[]
